package com.hanoiwiki.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.hanoiwiki.dao.PlacesInQueuedDAO;
import com.hanoiwiki.exception.DataAccessException;
import com.hanoiwiki.manager.PlacesInQueuedManager;
import com.hanoiwiki.model.PlacesInQueued;

@Component
@Transactional
public class PlacesInQueuedManagerImpl extends BaseManagerImpl implements PlacesInQueuedManager{
	
	@Autowired
	private PlacesInQueuedDAO placesInQueuedDAO;
	
	@Override
	public void save(PlacesInQueued placesInQueued) {
		try {
			placesInQueuedDAO.save(placesInQueued);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

	@Override
	public void update(PlacesInQueued placesInQueued) {
		try {
			placesInQueuedDAO.update(placesInQueued);
		} catch (DataAccessException e) {
			log.error("", e);
		}
	}

	@Override
	public PlacesInQueued get(Integer id) {
		try {
			return placesInQueuedDAO.get(id);
		} catch (DataAccessException e) {
			log.error("", e);
		}
		return null;
	}

	@Override
	public List<PlacesInQueued> getList() {
		try {
			return placesInQueuedDAO.getList();
		} catch (DataAccessException e) {
			log.error("", e);
		}
		return null;
	}

	@Override
	public void remove(Integer id) {
		try {
			placesInQueuedDAO.remove(id);
		} catch (DataAccessException e) {
			log.error("", e);
		}		
	}

}
